package com.uparlange.project.flextris.vo
{
	import mx.formatters.DateFormatter;

	/**
	 * Represents User Score
	 * 
	 * @author Ugo Parlange
	 */ 
	[RemoteClass]
	public class UserScoreVO
	{
		/**
		 * Date of score
		 */ 
		public var date : Date = new Date();
		
		/**
		 * User name
		 */ 
		public var username : String = "Anonymous";
		
		/**
		 * Score
		 */ 
		public var score : int = 0;
		
		/**
		 * Level
		 */ 
		public var level : int = 0;
		
		/**
		 * Number of lines
		 */  
		public var lines : int = 0
		
		/**
		 * Constructor
		 */ 
		public function UserScoreVO() {
			super();
		}
		
		/**
		 * Override toString
		 */ 
		public function toString() : String {
			var str : String = "{1} : {2}, level {3}, {4} line(s)";
			var dateFormatter : DateFormatter = new DateFormatter();
			dateFormatter.formatString = "DD/MM/YYY HH:NN:SS";
			str = str.replace("{0}", dateFormatter.format(date));
			str = str.replace("{1}", username);
			str = str.replace("{2}", score);
			str = str.replace("{3}", level);
			str = str.replace("{4}", lines);
			return str;
		}
	}
}